﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Projectmanagement.Utl;
using Projectmanagement.Entity;

namespace Projectmanagement.Controllers
{
    public class TaskFixController : Controller
    {
        //
        // GET: /TaskFix/

        public ActionResult Index()
        {
            var data = from t in CH.DB.Tasks where t.ProjectID != t.Milestone.Projectid select t;
            return View(data);
        }


        public ActionResult Edit(int id)
        {
            var data = CH.GetDataByID<Task>(id);
            return View(data);
        }

        [HttpPost]
        public ActionResult Edit(Task task)
        {
            CH.Edit<Task>(task);
            return RedirectToAction("index");
        }

    }
}
